<?php
	class modele_Inscription extends DBMapper{

		function inscription($mail,$pseudo,$mdp){
			
			$selecPreparee = self::$database->prepare("SELECT * FROM Utilisateur WHERE pseudo LIKE ?");	
			$selecPreparee->execute(array($pseudo));
			$tableauArgs = Array();	
			$tableauArgs = $selecPreparee->fetchAll();	
			
			if(!empty($tableauArgs)){
				return 0;
			}
			else{
				$selecPreparee = self::$database->prepare('INSERT INTO `Utilisateur` (`pseudo`, `mdp`, `mail`) VALUES (?, ?, ?)');
				$selecPreparee->execute(Array($pseudo,sha1($mdp),$mail));
				
				return 1;
			}
		}

	}
?>